﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

//namespace GeoFinderWP7
//{
//  public partial class PushSettings : PhoneApplicationPage
//  {
//    ClientPage cp = null;
//    PushContext pc = null;
//    public PushSettings()
//    {
//      InitializeComponent();
//    }
//    public PushSettings(ClientPage clientPage, PushContext pushContext)
//    {
//      cp = clientPage;
//      pc = pushContext;

//      InitializeComponent();

//      notifications_status.IsChecked = pc.IsPushEnabled;
//      toast_status.IsChecked = pc.IsToastEnabled;
//      tile_status.IsChecked = pc.IsTileEnabled;
//      raw_status.IsChecked = pc.IsRawEnabled;

//      if (notifications_status.IsChecked.Value)
//      {
//        toast_status.Opacity = 1;
//        tile_status.Opacity = 1;
//        raw_status.Opacity = 1;
//      }
//      else
//      {
//        toast_status.Opacity = 0.7;
//        tile_status.Opacity = 0.7;
//        raw_status.Opacity = 0.7;
//      }      
//    }

//    private void button1_Click(object sender, RoutedEventArgs e)
//    {
//      Application.Current.RootVisual = cp;
//    }

//    private void button2_Click(object sender, RoutedEventArgs e)
//    {
//      try
//      {
//        var client = new service.GeoFinderClient();
//        client.UpdatePushSettingsCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_UpdatePushSettingsCompleted);
//        client.UpdatePushSettingsAsync
//          (App.me,
//           notifications_status.IsChecked.Value,
//           raw_status.IsChecked.Value,
//           tile_status.IsChecked.Value,
//           toast_status.IsChecked.Value);
//        Application.Current.RootVisual = cp;
//      }
//      catch (Exception ex)
//      {
//        ex.Show();
//      }

//    }

//    void client_UpdatePushSettingsCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
//    {
//      pc.IsPushEnabled = notifications_status.IsChecked.Value;
//      pc.IsRawEnabled = raw_status.IsChecked.Value;
//      pc.IsTileEnabled = tile_status.IsChecked.Value;
//      pc.IsToastEnabled = toast_status.IsChecked.Value;
//    }

//    private void notifications_status_Checked(object sender, RoutedEventArgs e)
//    {
//      toast_status.IsEnabled = true;
//      tile_status.IsEnabled = true;
//      raw_status.IsEnabled = true;

//      toast_status.Opacity = 1;
//      tile_status.Opacity = 1;
//      raw_status.Opacity = 1;
//    }

//    private void notifications_status_Unchecked(object sender, RoutedEventArgs e)
//    {
//      toast_status.IsEnabled = false;
//      tile_status.IsEnabled = false;
//      raw_status.IsEnabled = false;

//      toast_status.Opacity = 0.7;
//      tile_status.Opacity = 0.7;
//      raw_status.Opacity = 0.7;
//    }    
//  }
//}